﻿namespace In66.Net.Mapper.Extensions
{
    public static class ServiceCollectionExtension
    {
        public static IServiceCollection AddInfraAutoMapper(this IServiceCollection services, params Type[] profileAssemblyMarkerTypes)
        {
            services.AddAutoMapper(profileAssemblyMarkerTypes);
            services.AddSingleton<IObjectMapper, AutoMapperObject>();
            return services;
        }

        public static IServiceCollection AddInfraAutoMapper(this IServiceCollection services, params Assembly[] assemblies)
        {
            services.AddAutoMapper(assemblies);
            services.AddSingleton<IObjectMapper, AutoMapperObject>();
            return services;
        }
    }
}
